<html>
<head><meta charset="utf-8"><title>real fancy highlighting · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html">real fancy highlighting</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204536901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204536901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204536901">(Jul 21 2020 at 11:37)</a>:</h4>
<p><a href="https://buttondown.email/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/">https://buttondown.email/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/</a></p>
<p>When do we get some of these in RLS? :-)</p>



<a name="204537128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537128">(Jul 21 2020 at 11:40)</a>:</h4>
<p>r-a has rainbow highlighting, but it seems to be broken at the moment: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/2436">https://github.com/rust-analyzer/rust-analyzer/issues/2436</a></p>



<a name="204537166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537166">(Jul 21 2020 at 11:40)</a>:</h4>
<p>The trickier part is probably combining all that info while still keeping the result somewhat understandable</p>



<a name="204537183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537183">(Jul 21 2020 at 11:40)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/issues/4691">https://github.com/rust-analyzer/rust-analyzer/issues/4691</a> would be nice tho'</p>



<a name="204537337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537337">(Jul 21 2020 at 11:42)</a>:</h4>
<p>We have a bunch of highligting niceties:</p>
<ul>
<li>enums, sturts, traits and modules are "colored" differently (actual color depends on the editor's color theme, of course). Same for locals vs parametres.</li>
<li>we underline things which are <code>mut</code> (not only in the definition, also in usages)</li>
<li>we flag actually unsafe operations in <code>unsafe</code> blocks</li>
</ul>



<a name="204537351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537351">(Jul 21 2020 at 11:43)</a>:</h4>
<p>Also see <code>editor.semanticTokenColorCustomizations</code> for building your own highlighting</p>



<a name="204537400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537400">(Jul 21 2020 at 11:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> might be hard to do that in Emacs :D</p>



<a name="204537472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537472">(Jul 21 2020 at 11:44)</a>:</h4>
<p>Ah, yeah. But that's an editor limitation ;)</p>



<a name="204537688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537688">(Jul 21 2020 at 11:47)</a>:</h4>
<p>We also support highlighting for <code>?</code> IIRC. I think being hard to notice was one of the bigger complaints about it.</p>



<a name="204537742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204537742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204537742">(Jul 21 2020 at 11:48)</a>:</h4>
<p>Emacs being less customizable than something else sounds silly <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="204538043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204538043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204538043">(Jul 21 2020 at 11:52)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> one think I've wanted for a long time is exit point higlighting:</p>
<p><a href="/user_uploads/4715/qbJ9NdNGGM_vVGJ22K7AeohR/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/qbJ9NdNGGM_vVGJ22K7AeohR/image.png" title="image.png"><img src="/user_uploads/4715/qbJ9NdNGGM_vVGJ22K7AeohR/image.png"></a></div><p>(note subtle background around <code>?</code> and the tail expr)</p>
<p>I think this should be implementable on top of highlight ranges request</p>



<a name="204538089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204538089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204538089">(Jul 21 2020 at 11:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/real.20fancy.20highlighting/near/204537183">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/issues/4691">https://github.com/rust-analyzer/rust-analyzer/issues/4691</a> would be nice tho'</p>
</blockquote>
<p>^^</p>



<a name="204538185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204538185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204538185">(Jul 21 2020 at 11:54)</a>:</h4>
<p>Yeah, we could use the semantic highlighting support</p>



<a name="204538233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204538233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204538233">(Jul 21 2020 at 11:55)</a>:</h4>
<p>I am thinking rather about <a href="https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight">https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight</a></p>



<a name="204538341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204538341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204538341">(Jul 21 2020 at 11:56)</a>:</h4>
<p>Oh</p>



<a name="204544077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204544077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204544077">(Jul 21 2020 at 13:01)</a>:</h4>
<p>You could probably abuse the <code>Write</code> kind since I think that one stands out more than <code>Read</code>.</p>



<a name="204544111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204544111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204544111">(Jul 21 2020 at 13:01)</a>:</h4>
<p>I am a little surprised that's not an open list actually</p>



<a name="204616353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204616353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> woody77 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204616353">(Jul 21 2020 at 23:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/real.20fancy.20highlighting/near/204538043">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> one think I've wanted for a long time is exit point higlighting:</p>
<p><a href="/user_uploads/4715/qbJ9NdNGGM_vVGJ22K7AeohR/image.png">image.png</a> </p>
<p>(note subtle background around <code>?</code> and the tail expr)</p>
<p>I think this should be implementable on top of highlight ranges request</p>
</blockquote>
<p>That's an awesome modifier to add to the semantic highlighting.  Too bad that VSCode (at least) can't set background colors in semantic highlighting..</p>



<a name="204628727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204628727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204628727">(Jul 22 2020 at 04:08)</a>:</h4>
<p>Maybe we should file an issue for that</p>



<a name="204645150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204645150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204645150">(Jul 22 2020 at 09:19)</a>:</h4>
<p><span class="user-mention" data-user-id="301314">@woody77</span> hm, yeah, I think it makes sense to add this as a modifier as well, even if themes can't take advantage of it right now</p>



<a name="204868755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204868755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> woody77 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204868755">(Jul 24 2020 at 00:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/real.20fancy.20highlighting/near/204628727">said</a>:</p>
<blockquote>
<p>Maybe we should file an issue for that</p>
</blockquote>
<p>Lemme go do that...</p>



<a name="204869474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/real%20fancy%20highlighting/near/204869474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> woody77 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/real.20fancy.20highlighting.html#204869474">(Jul 24 2020 at 00:47)</a>:</h4>
<p>Turns out background highlighting is an old issue that's in the backlog:  <a href="https://github.com/microsoft/vscode/issues/3429">https://github.com/microsoft/vscode/issues/3429</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>